#include <iostream>
#include <vector>
#include <set>
#include <memory>
#include <map>
#include <sstream>
using namespace std;
using line_no=vector<string>::size_type;
class QueryResult{
    using line_no=vector<string>::size_type;
    public:
        QueryResult(set<line_no> ln,shared_ptr<vector<string>> f,string s)
        :lines(ln)
        ,files(f)
        ,sought(s)
    {

    }
        set<line_no> lines;
        shared_ptr<vector<string>> files;
        string sought;
};
//管理文本并且提供查询基础
class TextQuery{
    using line_no=vector<string>::size_type;
public:
    TextQuery(ifstream & in){
        string line;
        while(getline(in,line)){
            file->push_back(line);
            line_no n=file->size()-1;

            istringstream iss(line);
            string word;
            while(iss>>word){
                word_map[word].insert(n);
            }
        }
    }


private:
    shared_ptr<vector<string>> file=make_shared<vector<string>>();
    map<string,set<line_no>> word_map;
};
void test(){
    
}
int main(int argc, char * argv[]){
    
    return 0;
}

